/*
 * stationlist.h
 *
 *  Created on: 2013-2-17
 *      Author: panqiuhui
 */

#ifndef STATIONLIST_H_
#define STATIONLIST_H_
#include <stdbool.h>
#include "traininfo.h"

struct train_through_stationinfo {
	char stationName[STATIONS_STATION_NAME_LEN];
	char stationArriveTime[THROUGH_STATIONS_ARRIVE_TIME_LEN];
	char stationDepartTime[THROUGH_STATIONS_DEPART_TIME_LEN];
	char consumeTime[THROUGH_STATIONS_CONSUME_TIME_LEN];
	char price[THROUGH_STATIONS_PRICE_LEN];
};

typedef struct train_through_stationinfo StationItem;

typedef struct station_node {
	StationItem item;
	struct station_node *next;
} StationNode;

typedef StationNode * StationList;

void InitializeListStation(StationList * plist);

bool ListIsEmptyStation(const StationList * plist);

bool ListIsFullStation(const StationList * plist);

unsigned int ListItemCountStation(const StationList * plist);

bool AddItemStation(StationItem item, StationList *plist);

void TraverseStation(const StationList * plist, void (*pfun)(StationItem item));

void EmptyTheListStation(StationList * plist);

#endif /* STATIONLIST_H_ */
